package com.zjhcsoft.shop.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;

import com.zjhcsoft.common.action.SysAbstractAction;
import com.zjhcsoft.shop.model.ListProduct;
import com.zjhcsoft.shop.model.Product;
import com.zjhcsoft.shop.model.User;
import com.zjhcsoft.shop.service.ProductService;
import com.zjhcsoft.shop.sys.shoputil.UserUtil;

@Controller
public class IndexAction extends SysAbstractAction {
	private User user;
	private List<ListProduct> newList;
	private List<ListProduct> fineLsit;
	private List<ListProduct> onsaleList;
	
	
	@Resource
	private ProductService productService;
	public String index(){
		newList = productService.findProductList(1, 50, "createtime");
		fineLsit = productService.findProductList(2, 50, "ordernum");
		onsaleList = productService.findProductList(3, 50, "ordernum");
		
		user=UserUtil.getUserFromCookies();
		
		
		return "index";
	}
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	public List<ListProduct> getNewList() {
		return newList;
	}
	public void setNewList(List<ListProduct> newList) {
		this.newList = newList;
	}
	public List<ListProduct> getFineLsit() {
		return fineLsit;
	}
	public void setFineLsit(List<ListProduct> fineLsit) {
		this.fineLsit = fineLsit;
	}
	public List<ListProduct> getOnsaleList() {
		return onsaleList;
	}
	public void setOnsaleList(List<ListProduct> onsaleList) {
		this.onsaleList = onsaleList;
	}
	

	
}
